﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Text;
using SportsStore.WebUI.Models;
using SportsStore.Domain.Abstract;
using SportsStore.Domain.Entities;
using System.Web.Mvc.Html;
using SportsStore.Domain.Concrete;

namespace SportsStore.WebUI.HTMLHelpers
{
    public static class CategoryDDLHelper
    {
        public static MvcHtmlString CategoryDropDownList(
        this HtmlHelper html, Category c)
        {
            EEPCategoryRepository ag = new EEPCategoryRepository();

            SelectList stateList;
            if (c != null)
            {
                stateList = new SelectList(ag.Categories, "CategoryID", "Description", c.CategoryID);
            }
            else
            {
                stateList = new SelectList(ag.Categories, "CategoryID", "Description");
            }

            return html.DropDownList("poronga", stateList, "-- Select a state --");
        }
    }
}